package com.wangp.五张表.controller;


import com.wangp.五张表.dto.request.UserQueryListRequest;
import com.wangp.五张表.dto.response.UserQueryListResponse;
import com.wangp.五张表.service.UserService;
import com.wangp.五张表.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 第一行简要描述.
 * </p>
 *
 * @author wangping
 * @since 2024-12-25
 */
@RestController
@RequestMapping("/v2")
public class UserController {

    @Autowired
    private UserService userService;


    /**
     * 测试数链路打通
     * @return
     * @param <T>
     */
    @GetMapping("test")
    public <T> Result<T> list(){
        userService.test();
        return Result.ok();
    }


    /**
     * 查询用户信息及权限
     * @return
     */
    @GetMapping("user")
    public Result<List<UserQueryListResponse>> list(UserQueryListRequest userReqDTO){
        return Result.ok(userService.queryPage(userReqDTO));
    }

}
